Repository navigation
Add notice when test-smokes runs without dev knitr/rmarkdown - #15012
Merged
Merged
Conversation
The Restore R packages step installs dev rmarkdown and knitr from r-universe inside try(). When that install fails, the renv-restored CRAN version stays installed and the tests silently run against it, so a run can look like it tested dev versions when it did not. Failing setup here would not help: both packages are in renv.lock and the step already stops if renv::status() is not synchronized, and a failed install.packages() leaves the existing version in place (an unreachable repo only warns and falls back to CRAN; a corrupt archive errors but keeps the old install). Falling back is the intended tolerance for r-universe flakiness. Instead, check the DESCRIPTION Repository field after the install and emit a ::notice:: naming the version and source in use when it is not an r-universe URL. Comparing the source rather than the version avoids a false positive when the dev and CRAN versions coincide right after a release.
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
Restore R packagesstep intest-smokes.ymlinstalls the dev versions of rmarkdown and knitr from r-universe insidetry(). When this install fails, the version restored by renv stays in place and the tests run against the CRAN release with nothing in the log, so a run can look like it tested dev versions when it did not.Failing the step was considered but would not catch anything. Both packages are in
tests/renv.lockand the step already stops whenrenv::status()is not synchronized. In my tests (R 4.6, Windows binaries), a failedinstall.packages()leaves the existing version installed: an unreachable repo only warns and falls back to CRAN fromrepos, and a corrupt archive errors but keeps the previous install. Falling back to CRAN is also the expected tolerance for r-universe flakiness.So after the install, the step now reads the
Repositoryfield from each package DESCRIPTION and emits a::notice::with the version and source in use when it is not an r-universe URL:The source is compared rather than the version, so there is no false positive when dev and CRAN versions are the same right after a release.
I checked the snippet locally against a library with CRAN versions (one notice per package) and one with r-universe versions (no output).
Checklist
I have (if applicable):
AI-assisted PR
Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.